package org.leo.test.guava.eventbus.day1;

import com.google.common.eventbus.DeadEvent;
import com.google.common.eventbus.Subscribe;
import lombok.extern.slf4j.Slf4j;

/**
 * <p>
 *
 * </p>
 *
 * @Package: org.leo.test.guava.eventbus.day1
 * @ClassName: DeadEventListener
 * @author: Li.Junlin
 * @date: 2019.12.16 11:42
 */
@Slf4j
public class DeadEventListener {
    @Subscribe
    public void handle(DeadEvent event) {
        //获取事件源
        log.info(String.valueOf(event.getSource()));//DEAD-EVENT-BUS
        //获取事件
        log.info(String.valueOf(event.getEvent()));//DeadEventListener event
    }

    @Subscribe
    public void handle(final Integer event){
        log.info("integer: {}", event);
    }
}
